package fr.pascal.client.ui.animal;

import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.user.client.ui.Anchor;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Widget;

import fr.pascal.client.place.ChatPlace;

public class KangourouViewImpl extends Composite implements KangourouView {

	private static KangourouViewImplUiBinder uiBinder = GWT.create(KangourouViewImplUiBinder.class);

	interface KangourouViewImplUiBinder extends UiBinder<Widget, KangourouViewImpl> {
	}

	private Presenter presenter;
	
	@UiField
	Anchor urlChat;
	
	@UiField
	Label nomKangourou;

	public KangourouViewImpl() {
		initWidget(uiBinder.createAndBindUi(this));
	}

	@Override
	public void setPresenter(Presenter presenter) {
		this.presenter = presenter;
	}
	
	@UiHandler("urlChat")
	void onUrlChatClick(ClickEvent event) {
		presenter.goTo(new ChatPlace("garfield"));
	}

	@Override
	public void setNomKangourou(String nomKangourou) {
		this.nomKangourou.setText(nomKangourou);
	}
}
